home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn Microsoft Visual Basic 6.0 Now
/
Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO
/
media
/
chap01
/
b01a020.cc2
< prev
next >
Wrap
Text File
|
1998-06-07
|
2KB
|
46 lines
0, The hottest spot in the casino is always
3, the slot machine pit. And the king of
5, one-armed bandits is Lucky Seven, a slot
8, machine that randomly displays numbers
9, in a bank of three or more spinning
11, windows. Lucky Seven is not a good way to
14, make a living, but it's a great way to
16, challenge Lady Luck. If one or more sevens
18, appear in the spinner windows,
20, bingo! You've hit the jackpot!! To create a
23, computer version of the Lucky Seven slot
25, machine, you need to think carefully about
27, the basic features of the Lucky Seven
28, game. The best way to chart the mission of
31, your program is to create an algorithm,
34, an ordered list of steps that your
35, program should follow. The Lucky Seven
38, program should complete four tasks. First, it
42, should display a welcoming user
43, interface with control buttons, spinner windows,
46, and a mechanism for announcing a win.
49, Second, it should have the ability to
51, pick three random numbers and display them
53, in the spinner windows when the user
55, clicks Spin. Third, Lucky Seven should
58, announce a jackpot by displaying a stack of
60, casino coins and beeping when a seven
63, appears. Finally, Lucky Seven should stop
66, when the user clicks the End button.
71, This basic algorithm translates into three
73, fundamental programming steps in Visual
74, Basic: creating the user interface,
77, setting the properties, and writing the
79, code. To build the user interface, I'll
82, create seven objects on a form with tools in
84, the Visual Basic toolbox. To set the
87, properties, I'll customize the objects
89, with 10 property settings. Finally, I'll
92, use the Code window to write program code
94, for the two control buttons on the form,
96, Spin and End. Roughing out these basic
100, planning steps is always a good way to
102, start the software development process.
105, With a solid algorithm in place, you're
107, ready to get started!
110, END